<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>snakeText</title>
<META http-equiv="content-type" CONTENT="text/html;charset=gb2312">
<META NAME="Author" CONTENT="CZH;czh44@sohu.com">
<META NAME="Generator" CONTENT="EditPlus">
</head>
<style type="text/css">
.laystyle {position:absolute;top:-50px;font-size:12pt;font-weight:bold;}
</style>
<script language="JavaScript">
/*--------------------------------\
|  Authored by CZH;czh44@sohu.com |
\--------------------------------*/
var theX=0,theY=0; 
var space1=15;
var space2=15;
var flag=0;
var message="Welcome To Our Station!!";
messageArray=message.split("");
var xpos=new Array();
for (i=0;i<=message.length-1;i++) 
{
xpos[i]=-50;
}
var ypos=new Array();
for (i=0;i<=messageArray.length-1;i++) 
{
ypos[i]=-50;
}
ifNN4=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4);
ifNN6=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==5);
function getMousePos(e)
{
	
	if(ifNN4||ifNN6)
	{
	theX=e.pageX;
	theY=e.pageY;
	}
	else
	{
	theX=document.body.scrollLeft+event.clientX;
	theY=document.body.scrollTop+event.clientY;
	}
	flag=1;
}
function makesnake() 
{
	if(flag==1)
	{
	if (ifNN4) 
	{
    	for (i=messageArray.length-1; i>=1; i--) 
		{
   		xpos[i]=xpos[i-1]+space2;
		ypos[i]=ypos[i-1];
		}
		xpos[0]=theX+space1;
		ypos[0]=theY;
		for (i=0; i<messageArray.length-1; i++) 
		{
    	eval("document.div"+i).left=xpos[i];
		eval("document.div"+i).top=ypos[i];
		}
	}
	else 
	{
    	for (i=messageArray.length-1; i>=1; i--) 
		{
		xpos[i]=xpos[i-1]+space2;
		ypos[i]=ypos[i-1];    	
		}
		xpos[0]=theX+space1;
		ypos[0]=theY;
		for (i=0; i<messageArray.length-1; i++) 
		{
   		document.getElementById("div"+i).style.left=xpos[i];
		document.getElementById("div"+i).style.top=ypos[i];  	
		}	
	}
	}
setTimeout("makesnake()",30);
}

for (i=0;i<=messageArray.length-1;i++) 
{
    document.write("<div id='div"+i+"' class='laystyle'>");
	document.write(messageArray[i]);
    document.write("</div>");
}
if (ifNN4||ifNN6)
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=getMousePos;
</script>
<body onLoad="makesnake()">
</body>
</html>
